LanguageExt.Core

LanguageExt.Core DataTypes Immutable Collections Arr

Contents

struct Arr <A> Source #

Immutable array Native array O(1) read performance. Modifications require copying of the entire array to generate the newly mutated version. This is will be very expensive for large arrays.

Parameters

type A

Value type

Fields

field Arr<A> Empty = new Arr<A>(new A[0] { }) Source #

Empty array

Indexers

this [ A ] Source #

Index accessor

Properties

property Lens<Arr<A>, A> head Source #

Head lens

property Lens<Arr<A>, Option<A>> headOrNone Source #

Head or none lens

property Lens<Arr<A>, A> last Source #

Last lens

property Lens<Arr<A>, Option<A>> lastOrNone Source #

Last or none lens

property object Case Source #

Reference version for use in pattern-matching

Empty collection     = result is null
Singleton collection = result is A
More                 = result is (A, Seq<A>) -- head and tail

Example:

var res = arr.Case switch
{

   A value         => ...,
   (var x, var xs) => ...,
   _               => ...
}

property bool IsEmpty Source #

Is the stack empty

property int Count Source #

Number of items in the stack

property int Length Source #

Alias of Count

Constructors

constructor Arr (IEnumerable<A> initial) Source #

Ctor

Methods

method Lens<Arr<A>, A> item (int index) Source #

Item at index lens

method Lens<Arr<A>, Option<A>> itemOrNone (int index) Source #

Item or none at index lens

method Lens<Arr<A>, Arr<B>> map <B> (Lens<A, B> lens) Source #

Lens map

method Arr<A> Add (A value) Source #

Add an item to the end of the array

method Arr<A> AddRange (IEnumerable<A> items) Source #

Add a range of items to the end of the array

method Arr<A> Clear () Source #

Clear the array

method Enumerator GetEnumerator () Source #

Get enumerator

method int IndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the index of an item

method int LastIndexOf (A item, int index = -1, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the index of an item

method int IndexOf <EQ> (A item, int index = 0, int count = -1) Source #

where EQ : struct, Eq<A>

Find the index of an item

method int LastIndexOf <EQ> (A item, int index = -1, int count = -1) Source #

where EQ : struct, Eq<A>

Find the index of an item

method Arr<A> Insert (int index, A value) Source #

Insert value at specified index

method Arr<A> InsertRange (int index, IEnumerable<A> items) Source #

Insert range of values at specified index

method Arr<A> Remove (A value) Source #

Remove an item from the array

method Arr<A> Remove (A value, IEqualityComparer<A> equalityComparer) Source #

Remove an item from the array

method Arr<A> Remove <EQ> (A value) Source #

where EQ : struct, Eq<A>

Remove an item from the array

method Arr<A> RemoveAll (Predicate<A> pred) Source #

Remove all items that match a predicate

method Arr<A> RemoveAt (int index) Source #

Remove item at location

Parameters

param index
returns

method Arr<A> RemoveRange (int index, int count) Source #

Remove a range of items

method Arr<A> SetItem (int index, A value) Source #

Set an item at the specified index

method IEnumerable<A> AsEnumerable () Source #

method Seq<A> ToSeq () Source #

method string ToString () Source #

Format the collection as [a, b, c, ...] The elipsis is used for collections over 50 items To get a formatted string with all the items, use ToFullString or ToFullArrayString.

method string ToFullString (string separator = ", ") Source #

Format the collection as a, b, c, ...

method string ToFullArrayString (string separator = ", ") Source #

Format the collection as [a, b, c, ...]

method IEnumerable<A> Skip (int amount) Source #

method Arr<A> Reverse () Source #

Reverse the order of the items in the array

method S Fold <S> (S state, Func<S, A, S> folder) Source #

Fold

method Arr<A> Do (Action<A> f) Source #

Impure iteration of the bound values in the structure

Parameters

returns

Returns the original unmodified structure

method Arr<B> Map <B> (Func<A, B> map) Source #

Map

method Arr<A> Filter (Func<A, bool> pred) Source #

Filter

method Arr<A> Append (Arr<A> rhs) Source #

method bool Equals (object obj) Source #

method int GetHashCode () Source #

Get the hash code Lazily (and once only) calculates the hash from the elements in the array Empty array hash == 0

method int CompareTo (object obj) Source #

method bool Equals (Arr<A> other) Source #

method int CompareTo (Arr<A> other) Source #

method Arr<B> Bind <B> (Func<A, Arr<B>> f) Source #

Operators

operator + (Arr<A> lhs, A rhs) Source #

operator + (A lhs, Arr<A> rhs) Source #

operator + (Arr<A> lhs, Arr<A> rhs) Source #

operator == (Arr<A> lhs, Arr<A> rhs) Source #

operator != (Arr<A> lhs, Arr<A> rhs) Source #

struct Enumerator Source #

Properties

property A Current Source #

Methods

method bool MoveNext () Source #

class ArrExtensions Source #

Methods

method A[] Flatten <A> (this A[][] ma) Source #

Monadic join

method Arr<A> Flatten <A> (this Arr<Arr<A>> ma) Source #

Monadic join

method TAccumulate Aggregate <TSource, TAccumulate> (this Arr<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func) Source #

Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.

method TResult Aggregate <TSource, TAccumulate, TResult> (this Arr<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector) Source #

Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.

method TSource Aggregate <TSource> (this Arr<TSource> source, Func<TSource, TSource, TSource> func) Source #

Applies an accumulator function over a sequence.

method bool All <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Determines whether all elements of a sequence satisfy a condition.

method bool Any <TSource> (this Arr<TSource> source) Source #

Determines whether a sequence contains any elements.

method bool Any <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Determines whether any element of a sequence satisfies a condition.

method IEnumerable<TSource> AsEnumerable <TSource> (this Arr<TSource> source) Source #

Returns the input typed as IEnumerable.

method IQueryable<TElement> AsQueryable <TElement> (this Arr<TElement> source) Source #

Converts a generic IEnumerable to a generic IQueryable.

method decimal Average (this Arr<decimal> source) Source #

Computes the average of a sequence of Decimal values.

method decimal Average <TSource> (this Arr<TSource> source, Func<TSource, decimal> selector) Source #

Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method decimal? Average (this Arr<decimal?> source) Source #

Computes the average of a sequence of nullable Decimal values.

method decimal? Average <TSource> (this Arr<TSource> source, Func<TSource, decimal?> selector) Source #

Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method double Average (this Arr<double> source) Source #

Computes the average of a sequence of Double values.

method double Average (this Arr<int> source) Source #

Computes the average of a sequence of Int32 values.

method double Average (this Arr<long> source) Source #

Computes the average of a sequence of Int64 values.

method double Average <TSource> (this Arr<TSource> source, Func<TSource, double> selector) Source #

Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.

method double Average <TSource> (this Arr<TSource> source, Func<TSource, int> selector) Source #

Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method double Average <TSource> (this Arr<TSource> source, Func<TSource, long> selector) Source #

Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method double? Average (this Arr<double?> source) Source #

Computes the average of a sequence of nullable Double values.

method double? Average (this Arr<int?> source) Source #

Computes the average of a sequence of nullable Int32 values.

method double? Average (this Arr<long?> source) Source #

Computes the average of a sequence of nullable Int64 values.

method double? Average <TSource> (this Arr<TSource> source, Func<TSource, double?> selector) Source #

Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.

method double? Average <TSource> (this Arr<TSource> source, Func<TSource, int?> selector) Source #

Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method double? Average <TSource> (this Arr<TSource> source, Func<TSource, long?> selector) Source #

Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method float Average (this Arr<float> source) Source #

Computes the average of a sequence of Single values.

method float Average <TSource> (this Arr<TSource> source, Func<TSource, float> selector) Source #

Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.

method float? Average (this Arr<float?> source) Source #

Computes the average of a sequence of nullable Single values.

method float? Average <TSource> (this Arr<TSource> source, Func<TSource, float?> selector) Source #

Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence.

method IEnumerable<TSource> Concat <TSource> (this Arr<TSource> first, IEnumerable<TSource> second) Source #

Concatenates two sequences.

method bool Contains <TSource> (this Arr<TSource> source, TSource value) Source #

Determines whether a sequence contains a specified element by using the default equality comparer.

method bool Contains <TSource> (this Arr<TSource> source, TSource value, IEqualityComparer<TSource> comparer) Source #

Determines whether a sequence contains a specified element by using a specified IEqualityComparer.

method int Count <TSource> (this Arr<TSource> source) Source #

Returns the number of elements in a sequence.

method int Count <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns a number that represents how many elements in the specified sequence satisfy a condition.

method IEnumerable<TSource> DefaultIfEmpty <TSource> (this Arr<TSource> source) Source #

Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.

method IEnumerable<TSource> DefaultIfEmpty <TSource> (this Arr<TSource> source, TSource defaultValue) Source #

Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.

method IEnumerable<TSource> Distinct <TSource> (this Arr<TSource> source) Source #

Returns distinct elements from a sequence by using the default equality comparer to compare values.

method IEnumerable<TSource> Distinct <TSource> (this Arr<TSource> source, IEqualityComparer<TSource> comparer) Source #

Returns distinct elements from a sequence by using a specified IEqualityComparer to compare values.

method TSource ElementAt <TSource> (this Arr<TSource> source, int index) Source #

Returns the element at a specified index in a sequence.

method TSource ElementAtOrDefault <TSource> (this Arr<TSource> source, int index) Source #

Returns the element at a specified index in a sequence or a default value if the index is out of range.

method IEnumerable<TSource> Except <TSource> (this Arr<TSource> first, IEnumerable<TSource> second) Source #

Produces the set difference of two sequences by using the default equality comparer to compare values.

method IEnumerable<TSource> Except <TSource> (this Arr<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Produces the set difference of two sequences by using the specified IEqualityComparer to compare values.

method TSource First <TSource> (this Arr<TSource> source) Source #

Returns the first element of a sequence.

method TSource First <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns the first element in a sequence that satisfies a specified condition.

method TSource FirstOrDefault <TSource> (this Arr<TSource> source) Source #

Returns the first element of a sequence, or a default value if the sequence contains no elements.

method TSource FirstOrDefault <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

method IEnumerable<IGrouping<TKey, TElement>> GroupBy <TSource, TKey, TElement> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) Source #

Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.

method IEnumerable<IGrouping<TKey, TElement>> GroupBy <TSource, TKey, TElement> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

method IEnumerable<IGrouping<TKey, TSource>> GroupBy <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector) Source #

Groups the elements of a sequence according to a specified key selector function.

method IEnumerable<IGrouping<TKey, TSource>> GroupBy <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.

method IEnumerable<TResult> GroupBy <TSource, TKey, TElement, TResult> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.

method IEnumerable<TResult> GroupBy <TSource, TKey, TElement, TResult> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.

method IEnumerable<TResult> GroupBy <TSource, TKey, TResult> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.

method IEnumerable<TResult> GroupBy <TSource, TKey, TResult> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer.

method IEnumerable<TResult> GroupJoin <TOuter, TInner, TKey, TResult> (this Arr<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector) Source #

Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.

method IEnumerable<TResult> GroupJoin <TOuter, TInner, TKey, TResult> (this Arr<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer is used to compare keys.

method IEnumerable<TSource> Intersect <TSource> (this Arr<TSource> first, IEnumerable<TSource> second) Source #

Produces the set intersection of two sequences by using the default equality comparer to compare values.

method IEnumerable<TSource> Intersect <TSource> (this Arr<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Produces the set intersection of two sequences by using the specified IEqualityComparer to compare values.

method IEnumerable<TResult> Join <TOuter, TInner, TKey, TResult> (this Arr<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector) Source #

Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.

method IEnumerable<TResult> Join <TOuter, TInner, TKey, TResult> (this Arr<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer is used to compare keys.

method TSource Last <TSource> (this Arr<TSource> source) Source #

Returns the last element of a sequence.

method TSource Last <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns the last element of a sequence that satisfies a specified condition.

method TSource LastOrDefault <TSource> (this Arr<TSource> source) Source #

Returns the last element of a sequence, or a default value if the sequence contains no elements.

method TSource LastOrDefault <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.

method long LongCount <TSource> (this Arr<TSource> source) Source #

Returns an Int64 that represents the total number of elements in a sequence.

method long LongCount <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns an Int64 that represents how many elements in a sequence satisfy a condition.

method decimal Max (this Arr<decimal> source) Source #

Returns the maximum value in a sequence of Decimal values.

method decimal Max <TSource> (this Arr<TSource> source, Func<TSource, decimal> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Decimal value.

method decimal? Max (this Arr<decimal?> source) Source #

Returns the maximum value in a sequence of nullable Decimal values.

method decimal? Max <TSource> (this Arr<TSource> source, Func<TSource, decimal?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.

method double Max (this Arr<double> source) Source #

Returns the maximum value in a sequence of Double values.

method double Max <TSource> (this Arr<TSource> source, Func<TSource, double> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Double value.

method double? Max (this Arr<double?> source) Source #

Returns the maximum value in a sequence of nullable Double values.

method double? Max <TSource> (this Arr<TSource> source, Func<TSource, double?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.

method float Max (this Arr<float> source) Source #

Returns the maximum value in a sequence of Single values.

method float Max <TSource> (this Arr<TSource> source, Func<TSource, float> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Single value.

method float? Max (this Arr<float?> source) Source #

Returns the maximum value in a sequence of nullable Single values.

method float? Max <TSource> (this Arr<TSource> source, Func<TSource, float?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Single value.

method int Max (this Arr<int> source) Source #

Returns the maximum value in a sequence of Int32 values.

method int Max <TSource> (this Arr<TSource> source, Func<TSource, int> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Int32 value.

method int? Max (this Arr<int?> source) Source #

Returns the maximum value in a sequence of nullable Int32 values.

method int? Max <TSource> (this Arr<TSource> source, Func<TSource, int?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value.

method long Max (this Arr<long> source) Source #

Returns the maximum value in a sequence of Int64 values.

method long Max <TSource> (this Arr<TSource> source, Func<TSource, long> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Int64 value.

method long? Max (this Arr<long?> source) Source #

Returns the maximum value in a sequence of nullable Int64 values.

method long? Max <TSource> (this Arr<TSource> source, Func<TSource, long?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value.

method TResult Max <TSource, TResult> (this Arr<TSource> source, Func<TSource, TResult> selector) Source #

Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.

method TSource Max <TSource> (this Arr<TSource> source) Source #

Returns the maximum value in a generic sequence.

method decimal Min (this Arr<decimal> source) Source #

Returns the minimum value in a sequence of Decimal values.

method decimal Min <TSource> (this Arr<TSource> source, Func<TSource, decimal> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Decimal value.

method decimal? Min (this Arr<decimal?> source) Source #

Returns the minimum value in a sequence of nullable Decimal values.

method decimal? Min <TSource> (this Arr<TSource> source, Func<TSource, decimal?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.

method double Min (this Arr<double> source) Source #

Returns the minimum value in a sequence of Double values.

method double Min <TSource> (this Arr<TSource> source, Func<TSource, double> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Double value.

method double? Min (this Arr<double?> source) Source #

Returns the minimum value in a sequence of nullable Double values.

method double? Min <TSource> (this Arr<TSource> source, Func<TSource, double?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.

method float Min (this Arr<float> source) Source #

Returns the minimum value in a sequence of Single values.

method float Min <TSource> (this Arr<TSource> source, Func<TSource, float> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Single value.

method float? Min (this Arr<float?> source) Source #

Returns the minimum value in a sequence of nullable Single values.

method float? Min <TSource> (this Arr<TSource> source, Func<TSource, float?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Single value.

method int Min (this Arr<int> source) Source #

Returns the minimum value in a sequence of Int32 values.

method int Min <TSource> (this Arr<TSource> source, Func<TSource, int> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Int32 value.

method int? Min (this Arr<int?> source) Source #

Returns the minimum value in a sequence of nullable Int32 values.

method int? Min <TSource> (this Arr<TSource> source, Func<TSource, int?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value.

method long Min (this Arr<long> source) Source #

Returns the minimum value in a sequence of Int64 values.

method long Min <TSource> (this Arr<TSource> source, Func<TSource, long> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Int64 value.

method long? Min (this Arr<long?> source) Source #

Returns the minimum value in a sequence of nullable Int64 values.

method long? Min <TSource> (this Arr<TSource> source, Func<TSource, long?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value.

method TResult Min <TSource, TResult> (this Arr<TSource> source, Func<TSource, TResult> selector) Source #

Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.

method TSource Min <TSource> (this Arr<TSource> source) Source #

Returns the minimum value in a generic sequence.

method IOrderedEnumerable<TSource> OrderBy <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector) Source #

Sorts the elements of a sequence in ascending order according to a key.

method IOrderedEnumerable<TSource> OrderBy <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer) Source #

Sorts the elements of a sequence in ascending order by using a specified comparer.

method IOrderedEnumerable<TSource> OrderByDescending <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector) Source #

Sorts the elements of a sequence in descending order according to a key.

method IOrderedEnumerable<TSource> OrderByDescending <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer) Source #

Sorts the elements of a sequence in descending order by using a specified comparer.

method IEnumerable<TSource> Reverse <TSource> (this Arr<TSource> source) Source #

Inverts the order of the elements in a sequence.

method bool SequenceEqual <TSource> (this Arr<TSource> first, IEnumerable<TSource> second) Source #

Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.

method bool SequenceEqual <TSource> (this Arr<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer.

method TSource Single <TSource> (this Arr<TSource> source) Source #

Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

method TSource Single <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

method TSource SingleOrDefault <TSource> (this Arr<TSource> source) Source #

Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

method TSource SingleOrDefault <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

method IEnumerable<TSource> Skip <TSource> (this Arr<TSource> source, int count) Source #

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

method IEnumerable<TSource> SkipWhile <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.

method IEnumerable<TSource> SkipWhile <TSource> (this Arr<TSource> source, Func<TSource, int, bool> predicate) Source #

Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.

method decimal Sum (this Arr<decimal> source) Source #

Computes the sum of a sequence of Decimal values.

method decimal Sum <TSource> (this Arr<TSource> source, Func<TSource, decimal> selector) Source #

Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method decimal? Sum (this Arr<decimal?> source) Source #

Computes the sum of a sequence of nullable Decimal values.

method decimal? Sum <TSource> (this Arr<TSource> source, Func<TSource, decimal?> selector) Source #

Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method double Sum (this Arr<double> source) Source #

Computes the sum of a sequence of Double values.

method double Sum <TSource> (this Arr<TSource> source, Func<TSource, double> selector) Source #

Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.

method double? Sum (this Arr<double?> source) Source #

Computes the sum of a sequence of nullable Double values.

method double? Sum <TSource> (this Arr<TSource> source, Func<TSource, double?> selector) Source #

Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.

method float Sum (this Arr<float> source) Source #

Computes the sum of a sequence of Single values.

method float Sum <TSource> (this Arr<TSource> source, Func<TSource, float> selector) Source #

Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.

method float? Sum (this Arr<float?> source) Source #

Computes the sum of a sequence of nullable Single values.

method float? Sum <TSource> (this Arr<TSource> source, Func<TSource, float?> selector) Source #

Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence.

method int Sum (this Arr<int> source) Source #

Computes the sum of a sequence of Int32 values.

method int Sum <TSource> (this Arr<TSource> source, Func<TSource, int> selector) Source #

Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method int? Sum (this Arr<int?> source) Source #

Computes the sum of a sequence of nullable Int32 values.

method int? Sum <TSource> (this Arr<TSource> source, Func<TSource, int?> selector) Source #

Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method long Sum (this Arr<long> source) Source #

Computes the sum of a sequence of Int64 values.

method long Sum <TSource> (this Arr<TSource> source, Func<TSource, long> selector) Source #

Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method long? Sum (this Arr<long?> source) Source #

Computes the sum of a sequence of nullable Int64 values.

method long? Sum <TSource> (this Arr<TSource> source, Func<TSource, long?> selector) Source #

Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method IEnumerable<TSource> Take <TSource> (this Arr<TSource> source, int count) Source #

Returns a specified number of contiguous elements from the start of a sequence.

method IEnumerable<TSource> TakeWhile <TSource> (this Arr<TSource> source, Func<TSource, bool> predicate) Source #

Returns elements from a sequence as long as a specified condition is true.

method IEnumerable<TSource> TakeWhile <TSource> (this Arr<TSource> source, Func<TSource, int, bool> predicate) Source #

Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.

method TSource[] ToArray <TSource> (this Arr<TSource> source) Source #

Creates an array from a IEnumerable.

method Dictionary<TKey, TElement> ToDictionary <TSource, TKey, TElement> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to specified key selector and element selector functions.

method Dictionary<TKey, TElement> ToDictionary <TSource, TKey, TElement> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to a specified key selector function, a comparer, and an element selector function.

method Dictionary<TKey, TSource> ToDictionary <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to a specified key selector function.

method Dictionary<TKey, TSource> ToDictionary <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to a specified key selector function and key comparer.

method List<TSource> ToList <TSource> (this Arr<TSource> source) Source #

Creates a List from an IEnumerable.

method ILookup<TKey, TElement> ToLookup <TSource, TKey, TElement> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to specified key selector and element selector functions.

method ILookup<TKey, TElement> ToLookup <TSource, TKey, TElement> (this Arr<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to a specified key selector function, a comparer and an element selector function.

method ILookup<TKey, TSource> ToLookup <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to a specified key selector function.

method ILookup<TKey, TSource> ToLookup <TSource, TKey> (this Arr<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to a specified key selector function and key comparer.

method IEnumerable<TSource> Union <TSource> (this Arr<TSource> first, IEnumerable<TSource> second) Source #

Produces the set union of two sequences by using the default equality comparer.

method IEnumerable<TSource> Union <TSource> (this Arr<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Produces the set union of two sequences by using a specified IEqualityComparer.

method IEnumerable<TResult> Zip <TFirst, TSecond, TResult> (this Arr<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector) Source #

Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.

method Arr<A> Filter <A> (this Arr<A> ma, Func<A, bool> f) Source #

method Arr<A> Where <A> (this Arr<A> ma, Func<A, bool> f) Source #

method Arr<B> Map <A, B> (this Arr<A> ma, Func<A, B> f) Source #

method Arr<B> Select <A, B> (this Arr<A> ma, Func<A, B> f) Source #

method Arr<B> Bind <A, B> (this Arr<A> ma, Func<A, Arr<B>> f) Source #

method Arr<B> SelectMany <A, B> (this Arr<A> ma, Func<A, Arr<B>> f) Source #

method Arr<C> SelectMany <A, B, C> (this Arr<A> ma, Func<A, Arr<B>> bind, Func<A, B, C> project) Source #

class Arr Source #

Methods

method Arr<T> empty <T> () Source #

Create an empty array

method Arr<T> create <T> () Source #

Create a new empty array

Parameters

returns

Lst T

method Arr<T> create <T> (params T[] items) Source #

Create an array from a initial set of items

Parameters

param items

Items

returns

Lst T

method Arr<T> createRange <T> (IEnumerable<T> items) Source #

Create an array from an initial set of items

Parameters

param items

Items

returns

Lst T

method Arr<T> add <T> (Arr<T> array, T value) Source #

Add an item to the array

Parameters

param array

Array

param value

Item to add

returns

A new Lst T

method Arr<T> addRange <T> (Arr<T> array, IEnumerable<T> value) Source #

Add a range of items to the array

Parameters

param array

Array

param value

Items to add

returns

A new Lst T

method Arr<T> remove <T> (Arr<T> array, T value) Source #

Remove an item from the array

Parameters

param array

Array

param value

value to remove

returns

A new Lst T

method Arr<T> removeAt <T> (Arr<T> array, int index) Source #

Remove an item at a specified index in the array

Parameters

param array

Array

param index

Index of item to remove

returns

A new Lst T

method T[] rev <T> (T[] array) Source #

Reverses the array (Reverse in LINQ)

Parameters

type T

Array item type

param array

Array to reverse

returns

Reversed list

method Arr<T> rev <T> (Arr<T> array) Source #

Reverses the array (Reverse in LINQ)

Parameters

type T

Array item type

param array

Array to reverse

returns

Reversed list

method A[] flatten <A> (A[][] ma) Source #

Monadic join

method Arr<A> flatten <A> (Arr<Arr<A>> ma) Source #

Monadic join